package service.impl;

import mapper.SContactMapper;
import org.apache.ibatis.session.SqlSession;
import pojo.Supplier;
import pojo.SupplierContact;
import service.SContactService;
import utils.MyBatisUtil;

import java.util.List;

/**
 * @auth 吴阳基
 * @date 2024/1/3 16:01
 */
public class SContactServiceImpl implements SContactService {
    SqlSession sqlSession = MyBatisUtil.createSqlSession();
    SContactMapper mapper = sqlSession.getMapper(SContactMapper.class);

    @Override
    public List<Supplier> SupplierList() {
        return mapper.SupplierList();
    }

    @Override
    public List<SupplierContact> byPidCnameList(String cname, int pid) {
        return mapper.byPidCnameList(cname, pid);
    }

    @Override
    public int add(SupplierContact supplierContact) {
        return mapper.add(supplierContact);
    }

    @Override
    public int delete(int id) {
        return mapper.delete(id);
    }
}
